.class final Lnbisdk/gm;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/nbi/map/route/RouteInformation;


# static fields
.field private static ca:Lcom/nbi/common/NBIContext;


# instance fields
.field private jp:[Lnbisdk/t;

.field private jq:Lnbisdk/ln;


# direct methods
.method public constructor <init>(Lcom/nbi/common/NBIContext;Ljava/lang/Object;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x3

    new-array v0, v0, [Lnbisdk/mj;

    iput-object v0, p0, Lnbisdk/gm;->jp:[Lnbisdk/t;

    sput-object p1, Lnbisdk/gm;->ca:Lcom/nbi/common/NBIContext;

    check-cast p2, Lnbisdk/ln;

    iput-object p2, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    return-void
.end method


# virtual methods
.method public final getBoundingBox()Lcom/nbi/map/data/BoundingBox;
    .locals 14

    const/4 v9, 0x1

    const/4 v8, 0x0

    const-wide/high16 v12, 0x4024

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v0}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v0

    array-length v0, v0

    const/4 v1, 0x2

    if-lt v0, v1, :cond_0

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v0}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v0

    aget-object v0, v0, v8

    invoke-virtual {v0}, Lnbisdk/cs;->getLatitude()D

    move-result-wide v0

    iget-object v2, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v2}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v2

    aget-object v2, v2, v9

    invoke-virtual {v2}, Lnbisdk/cs;->getLatitude()D

    move-result-wide v2

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(DD)D

    move-result-wide v0

    iget-object v2, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v2}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v2

    aget-object v2, v2, v8

    invoke-virtual {v2}, Lnbisdk/cs;->getLatitude()D

    move-result-wide v2

    iget-object v4, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v4}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v4

    aget-object v4, v4, v9

    invoke-virtual {v4}, Lnbisdk/cs;->getLatitude()D

    move-result-wide v4

    invoke-static {v2, v3, v4, v5}, Ljava/lang/Math;->max(DD)D

    move-result-wide v2

    iget-object v4, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v4}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v4

    aget-object v4, v4, v8

    invoke-virtual {v4}, Lnbisdk/cs;->getLongitude()D

    move-result-wide v4

    iget-object v6, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v6}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v6

    aget-object v6, v6, v9

    invoke-virtual {v6}, Lnbisdk/cs;->getLongitude()D

    move-result-wide v6

    invoke-static {v4, v5, v6, v7}, Ljava/lang/Math;->min(DD)D

    move-result-wide v4

    iget-object v6, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v6}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v6

    aget-object v6, v6, v8

    invoke-virtual {v6}, Lnbisdk/cs;->getLongitude()D

    move-result-wide v6

    iget-object v8, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v8}, Lnbisdk/ln;->ix()[Lnbisdk/cs;

    move-result-object v8

    aget-object v8, v8, v9

    invoke-virtual {v8}, Lnbisdk/cs;->getLongitude()D

    move-result-wide v8

    invoke-static {v6, v7, v8, v9}, Ljava/lang/Math;->max(DD)D

    move-result-wide v6

    sub-double v8, v6, v4

    div-double v10, v8, v12

    sub-double/2addr v4, v10

    div-double/2addr v8, v12

    add-double/2addr v6, v8

    sub-double v8, v2, v0

    div-double v10, v8, v12

    sub-double/2addr v0, v10

    div-double/2addr v8, v12

    add-double/2addr v2, v8

    new-instance v8, Lcom/nbi/map/data/BoundingBox;

    new-instance v9, Lcom/nbi/map/data/Coordinates;

    invoke-direct {v9, v0, v1, v4, v5}, Lcom/nbi/map/data/Coordinates;-><init>(DD)V

    new-instance v0, Lcom/nbi/map/data/Coordinates;

    invoke-direct {v0, v2, v3, v6, v7}, Lcom/nbi/map/data/Coordinates;-><init>(DD)V

    invoke-direct {v8, v9, v0}, Lcom/nbi/map/data/BoundingBox;-><init>(Lcom/nbi/map/data/Coordinates;Lcom/nbi/map/data/Coordinates;)V

    move-object v0, v8

    :goto_0
    return-object v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final getDelay()D
    .locals 2

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Lnbisdk/ln;->aK(I)D

    move-result-wide v0

    return-wide v0
.end method

.method public final getDestination()Lcom/nbi/map/data/Place;
    .locals 2

    new-instance v0, Lcom/nbi/map/data/Place;

    iget-object v1, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v1}, Lnbisdk/ln;->N()Lnbisdk/ej;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/nbi/map/data/Place;-><init>(Ljava/lang/Object;)V

    return-object v0
.end method

.method public final getDistance()D
    .locals 2

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v0}, Lnbisdk/ln;->getTotalDistance()D

    move-result-wide v0

    return-wide v0
.end method

.method public final getInternalObject()Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    return-object v0
.end method

.method public final getManeuverList()Lcom/nbi/map/data/ManeuverList;
    .locals 9

    const/4 v7, 0x0

    sget-object v0, Lnbisdk/gm;->ca:Lcom/nbi/common/NBIContext;

    invoke-virtual {v0}, Lcom/nbi/common/NBIContext;->getInternalObject()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnbisdk/bl;

    invoke-virtual {v0}, Lnbisdk/bl;->df()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    const-string v1, "en"

    const-string v2, "es"

    invoke-virtual {v0, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    const-string v0, "es"

    :goto_0
    iget-object v1, p0, Lnbisdk/gm;->jp:[Lnbisdk/t;

    new-instance v2, Lnbisdk/mj;

    sget-object v3, Lnbisdk/gm;->ca:Lcom/nbi/common/NBIContext;

    const-string v4, "data.tpl"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "directions-"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v5, ".tps"

    invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v2, v3, v4, v0}, Lnbisdk/mj;-><init>(Lcom/nbi/common/NBIContext;Ljava/lang/String;Ljava/lang/String;)V

    aput-object v2, v1, v7

    iget-object v0, p0, Lnbisdk/gm;->jp:[Lnbisdk/t;

    const/4 v1, 0x1

    new-instance v2, Lnbisdk/mj;

    sget-object v3, Lnbisdk/gm;->ca:Lcom/nbi/common/NBIContext;

    const-string v4, "data.tpl"

    const-string v5, "images.tps"

    invoke-direct {v2, v3, v4, v5}, Lnbisdk/mj;-><init>(Lcom/nbi/common/NBIContext;Ljava/lang/String;Ljava/lang/String;)V

    aput-object v2, v0, v1

    iget-object v0, p0, Lnbisdk/gm;->jp:[Lnbisdk/t;

    const/4 v1, 0x2

    new-instance v2, Lnbisdk/mj;

    sget-object v3, Lnbisdk/gm;->ca:Lcom/nbi/common/NBIContext;

    const-string v4, "data.tpl"

    const-string v5, "images.tps"

    invoke-direct {v2, v3, v4, v5}, Lnbisdk/mj;-><init>(Lcom/nbi/common/NBIContext;Ljava/lang/String;Ljava/lang/String;)V

    aput-object v2, v0, v1

    new-instance v0, Lnbisdk/ot;

    iget-object v1, p0, Lnbisdk/gm;->jp:[Lnbisdk/t;

    invoke-direct {v0, v1}, Lnbisdk/ot;-><init>([Lnbisdk/t;)V

    iget-object v1, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v1}, Lnbisdk/ln;->iw()I

    move-result v1

    new-instance v2, Ljava/util/Vector;

    invoke-direct {v2, v1}, Ljava/util/Vector;-><init>(I)V

    move v3, v7

    :goto_1
    if-ge v3, v1, :cond_1

    iget-object v4, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v4, v3}, Lnbisdk/ln;->aI(I)Lnbisdk/hq;

    move-result-object v4

    if-eqz v4, :cond_0

    new-instance v5, Lcom/nbi/map/data/Maneuver;

    new-instance v6, Lnbisdk/qq;

    sget-object v7, Lnbisdk/gm;->ca:Lcom/nbi/common/NBIContext;

    iget-object v8, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-direct {v6, v7, v4, v8, v0}, Lnbisdk/qq;-><init>(Lcom/nbi/common/NBIContext;Lnbisdk/hq;Lnbisdk/ln;Lnbisdk/ot;)V

    invoke-direct {v5, v3, v6}, Lcom/nbi/map/data/Maneuver;-><init>(ILjava/lang/Object;)V

    invoke-virtual {v2, v5}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    :cond_0
    add-int/lit8 v3, v3, 0x1

    goto :goto_1

    :cond_1
    new-instance v0, Lcom/nbi/map/data/ManeuverList;

    iget-object v1, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v1}, Lnbisdk/ln;->getRouteID()[B

    move-result-object v1

    invoke-direct {v0, v2, v1, p0}, Lcom/nbi/map/data/ManeuverList;-><init>(Ljava/util/Vector;[BLcom/nbi/map/route/RouteInformation;)V

    return-object v0

    :cond_2
    move-object v0, v1

    goto/16 :goto_0
.end method

.method public final getOrigin()Lcom/nbi/map/data/Place;
    .locals 2

    new-instance v0, Lcom/nbi/map/data/Place;

    iget-object v1, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v1}, Lnbisdk/ln;->O()Lnbisdk/ej;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/nbi/map/data/Place;-><init>(Ljava/lang/Object;)V

    return-object v0
.end method

.method public final getRouteError()S
    .locals 1

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v0}, Lnbisdk/ln;->getRouteError()S

    move-result v0

    return v0
.end method

.method public final getRouteID()[B
    .locals 1

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    invoke-interface {v0}, Lnbisdk/ln;->getRouteID()[B

    move-result-object v0

    return-object v0
.end method

.method public final getTime()D
    .locals 2

    iget-object v0, p0, Lnbisdk/gm;->jq:Lnbisdk/ln;

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Lnbisdk/ln;->aL(I)J

    move-result-wide v0

    long-to-double v0, v0

    return-wide v0
.end method

.method public final hasMoreResults()Z
    .locals 1

    const/4 v0, 0x0

    return v0
.end method
